package com.alcohol.auth.server.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Map;

/**
 * 客户端认证信息实体类
 * @author LiXinYu
 * @date 2025/11/7
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_oauth_client", autoResultMap = true)
public class SysOAuthClient extends BaseEntity {

    /* ID */
    private Long id;
    /* 客户端ID */
    private String clientId;
    /* 客户端名称 */
    private String clientName;
    /* 客户端秘钥 */
    private String clientSecret;
    /* 客户端头像 */
    private String clientAvatar;
    /* 客户端过期日期 */
    private String clientExpiresAt;
    /* 授权范围 */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> scope;
    /* 授权类型 */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> authorizedGrantTypes;
    /* 回调地址 */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> redirectUris;
    /* 访问令牌有效期（秒） */
    private Integer accessTokenValidity;
    /* 刷新令牌有效期（秒） */
    private Integer refreshTokenValidity;
    /* 附加信息 */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> additionalInformation;
    /* 自动授权 */
    private String autoApprove;
}
